BuffEffect22 = BaseBuffEffect:new();
BuffEffect22.__index = BuffEffect22;

function BuffEffect22:new()
    local object = {};
    setmetatable(object, BuffEffect22);
    return object;
end

function BuffEffect22:add(fight,buff)
    local values =decodeJsonStrToTabel(buff.buffBean.f_Value);
    buff.parameter = {values[4]};
    fightLog("[EFFECT]Fighter "..buff.target.fighterId.." Buff"..buff.modelId.." 增加场上生命值低于增加BUFF效果，次数："..buff.parameter[1]);
    return BaseBuffEffect:add(fight,buff)
end

function BuffEffect22:action(fight,buff,...)
    local fighter = buff.target;
    local values = decodeJsonStrToTabel(buff.buffBean.f_BuffEffectValue);

    fighter.energy = fighter.energy + values[1];
    if fighter.energy < 0 then
        fighter.energy = 0;
    elseif fighter.energy > fighter.maxEnergy then
        fighter.energy = fighter.maxEnergy;
    end
    local spPercent = fighter.energy/fighter.maxEnergy;
    fighter:setSP(spPercent);

    return BaseBuffEffect:action(fight, buff, ...);
end